#!/usr/bin/node

const http = require('http'),
    log = console.log;
   const  html = `<!DOCTYPE html>
     <html lang="en">
       <head>
           <meta charset="UTF-8">
               <title></title>
                 </head>
                   <body>
                     <form action="">
                         <label >username:</label>
                             <input type="text" name = "username">
                                 <br>
                                     <label >password:</label>
                                         <input type="password" name= "password">
                                             <br>
                                                 <label ></label>
                                                     <input type="button" value="login">
                                                         <br>
                                                           </form>
                                                           </body>
                                                           </html>
                                                           `;

http.createServer((req,res)=>{
  if(req.url !=='/'){
    res.statusCode=404;
    res.setHeader('Content-Type','text/html');
    res.end('<h1>not found</h1>');
    return ;
  }
  res.writeHead(200,{
  res.setHeader('Content-Type':'text/html');
  res.setHeader('Content-Length':Buffer.byteLength(html))});
   res.end(html);
).listen(8080);
